<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-title">
                <h5>充值排行查询</h5>
            </div>
            <div class="ibox-content">
                <form class="form-horizontal " action="<?php echo e(route('pay.rank')); ?>" method="post"
                      enctype="multipart/form-data">
                    <?php echo csrf_field(); ?>

                    <table class="table-striped table-bordered table-hover table-condensed">
                        <tr class="b-group">
                            <td class="b-child" colspan="2">
                                <table class="table-striped table-bordered table-hover table-condensed">
                                    <tr>
                                        <td>
                                            <?php echo $__env->make('widget.between_datetime',['showEndTime'=>true], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                        </td>
                                        <td>
                                            <?php echo $__env->make('widget.query_and_refresh', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                        </td>
                                        <td>
                                            <?php echo $__env->make('widget.dataType', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr class="b-group">
                            <th style="min-width: 108px;">
                                <label>全选/不选&nbsp;&nbsp;
                                    <input type="checkbox" checked="checked" value=""
                                           onclick="checkAll(this)"></label>
                            </th>
                            <td class="b-child">
                                <div style="max-height:6.5rem;overflow-y:scroll;">
                                    <?php echo $__env->make('widget.channel', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                </div>
                            </td>
                        </tr>
                        <tr class="b-group">
                            <th width="10%">
                                <label>全选/不选&nbsp;&nbsp;
                                    <input type="checkbox" checked="checked" value="" onclick="checkAll(this)"></label>
                            </th>
                            <td class="b-child">
                                <div style="max-height:10rem;overflow-y:scroll;">
                                    <?php echo $__env->make('widget.server', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                                </div>
                            </td>
                        </tr>
                    </table>
                    <input type="hidden" name="page_size" value="<?php echo e($reqPageSize); ?>"/>
                </form>
                <table class="table table-striped table-bordered table-hover m-t-md tblData">
                    <thead>
                    <tr>
                        <th class="text-center">排名</th>
                        <th class="text-center">角色名</th>
                        <th class="text-center">账号</th>
                        <th class="text-center">区服</th>
                        <th class="text-center">等级</th>

                        <th class="text-center">金额</th>
                        <th class="text-center">次数</th>
                        <th class="text-center">注册时间</th>
                        <th class="text-center">最近充值时间</th>
                        <th class="text-center">查看充值详情</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php
                    $preRank = 0;
                    $page = app('request')->input('page');
                    if (isset($page)) {
                        if ($page >= 2) {
                            $preRank = ($page - 1) * intval($payRank->perPage());
                        }
                    }

                    ?>
                    <?php $__currentLoopData = $payRank; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><?php echo e($preRank+$key+1); ?></td>
                            <td><?php echo e($item['nickname']); ?></td>
                            <td><?php echo e($item['account']); ?></td>
                            <td><?php echo e($item['server_name']); ?></td>
                            <td><?php echo e($item['level']); ?></td>

                            <td><?php echo e($item['total_amounts']); ?></td>
                            <td><?php echo e($item['pay_times']); ?></td>
                            <td><?php echo e($item['register_time']); ?></td>
                            <td><?php echo e($item['pay_time']); ?></td>
                            <td class="text-center">
                                <button class="btn btn-primary btn-xs" data-toggle="modal" data-uid="<?php echo e($item['_id']); ?>"
                                        data-target="#myModal">查看
                                </button>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
                <div class="pull-left pagination m-t-no">
                    <?php echo $__env->make('widget.page',['reqPageSize'=>$reqPageSize], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                </div>
                <div class="pull-right pagination m-t-no">
                    <div class="text-center">
                        <?php
                        if (count($payRank) > 0) {
                            echo $payRank->appends(
                                [
                                    'start_time' => $reqStartTime,
                                    'end_time' => $reqEndTime,
                                    'channel_id' => $str_arr_channels_id,
                                    'unique_id' => $str_arr_unique_id,
                                    'page_size' => app('request')->input('page_size'),
                                    'data_type' => app('request')->input('data_type'),
                                ])->links();
                        }
                        ?>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
    <script>
    </script>
    <link href="<?php echo e(loadEdition('/admin/css/plugins/datapicker/bootstrap-datepicker.css')); ?>" rel="stylesheet">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
    <!-- 模态框（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width: 90%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">充值详情</h4>
                </div>
                <div class="modal-body" id="divModal" style="height: 55rem;">

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <script src="<?php echo e(loadEdition('/admin/js/plugins/datapicker/bootstrap-datepicker.js')); ?>"></script>
    <script src="<?php echo e(loadEdition('/admin/js/plugins/datapicker/bootstrap-datepicker.zh-CN.js')); ?>"></script>
    <script src="<?php echo e(loadEdition('/js/global.js')); ?>"></script>
    <script>

        //查看详情
        $('#myModal').on('show.bs.modal', function (e) {
            //debugger;
            var uid = e.relatedTarget.getAttribute('data-uid');
            var url = '<?php echo e(route('pay.detail')); ?>?' + $('form').eq(0).serialize() + '&uid=' + uid;
            var n = '<iframe class="J_iframe" name="iframe" width="100%" height="100%" src="' + url + '" frameborder="0" seamless></iframe>';
            $('#divModal').html(n);
        })
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>